/*  1:   */ package org.intellij.plugins.relaxNG.compact;
/*  2:   */ 
/*  3:   */

import com.intellij.lang.ASTNode;
import com.intellij.util.NotNullFunction;
import org.intellij.plugins.relaxNG.compact.psi.RncElement;
import org.jetbrains.annotations.NotNull;

import java.lang.reflect.Constructor;
import java.lang.reflect.Modifier;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */ 
/* 10:   */ class RncElementTypeEx<C extends RncElement>
/* 11:   */   extends RncElementType
/* 12:   */   implements NotNullFunction<ASTNode, C>
/* 13:   */ {
/* 14:   */   private final Constructor<? extends C> a;
/* 15:   */   
/* 16:   */   RncElementTypeEx(String paramString, Class<? extends C> paramClass)
/* 17:   */   {
/* 18:33 */     super(paramString);
/* 19:34 */     assert ((!paramClass.isInterface()) && (!Modifier.isAbstract(paramClass.getModifiers())));
/* 20:   */     try
/* 21:   */     {
/* 22:36 */       this.a = paramClass.getConstructor(new Class[] { ASTNode.class });
/* 23:   */     }
/* 24:   */     catch (NoSuchMethodException localNoSuchMethodException)
/* 25:   */     {
/* 26:38 */       throw new Error(localNoSuchMethodException);
/* 27:   */     }
/* 28:   */   }
/* 29:   */   
/* 30:   */   @NotNull
/* 31:   */   public final C fun(ASTNode paramASTNode)
/* 32:   */   {
/* 33:   */     try
/* 34:   */     {
/* 35:45 */       RncElement tmp18_15 = ((RncElement)this.a.newInstance(new Object[] { paramASTNode }));
/* 36:45 */       if (tmp18_15 == null) {
/* 37:45 */         throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/plugins/relaxNG/compact/RncElementTypeEx", "fun" }));
/* 38:   */       }
/* 39:45 */       return tmp18_15;
/* 40:   */     }
/* 41:   */     catch (Exception localException)
/* 42:   */     {
/* 43:47 */       throw new Error(localException);
/* 44:   */     }
/* 45:   */   }
/* 46:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.plugins.relaxNG.compact.RncElementTypeEx

 * JD-Core Version:    0.7.0.1

 */